package com.xc.tjise.TJISE.day04;

public class StringTest {
    public static void main(String[] args) {
        String s1="张文远"; // String 的直接用法
        String s2= new String();
        String s3=new String("张鹏远");
        System.out.println(s1+s2+s3);
        char[] chars = {'z','h','a','n','g'};
        String s4= new String(chars);
        System.out.println(s4);
        System.out.println(s4.charAt(0));
        System.out.println(s4.replace('z','s'));
        System.out.println(s4);

        String s5= "zhang wen yuan ";
        String[] strings = s5.split(",");
        for (String string: strings){
            System.out.println(string);

            System.out.println(s5.substring(11));
            System.out.println(s5.substring(6,7)); // endIndex - 1
            System.out.println(String.valueOf('a'));
        }
    }
}
